package com.book;

import com.book.pojo.Books;
import com.book.service.BookServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class test {

    @Test
    public void test(){
        ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");

        BookServiceImpl bookService=context.getBean("BookServiceImpl",BookServiceImpl.class);
        List<Books> list=bookService.queryAllBook();
        for (Books b:list){
            System.out.println(b);
        }

    }
}
